package com.fit.entities.studentOfTheCourse;

import java.util.Date;

import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.tapestry5.beaneditor.NonVisual;

import com.fit.entities.course.Course;
import com.fit.entities.student.Student;
import com.fit.entities.user.User;

@Entity
@Table(name = "studentOfTheCourse")

public class StudentOfTheCourse {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "studentOfTheCourse_id")
	private Long studentOfTheCourseId;

	
	
	@ManyToOne(optional = false)
	@JoinColumn(name = "id")
	private User user;
	@ManyToOne(optional = false)
	@JoinColumn(name = "course_id")
	private Course course;
	@Column(name = "grade")
	private int grade;

	

	public Long getStudentOfTheCourseId() {
		return studentOfTheCourseId;
	}



	public int getGrade() {
		return grade;
	}



	public void setGrade(int grade) {
		this.grade = grade;
	}



	public void setStudentOfTheCourseId(Long studentOfTheCourseId) {
		this.studentOfTheCourseId = studentOfTheCourseId;
	}



	public User getUser() {
		return user;
	}



	public void setUser(User user) {
		this.user = user;
	}



	public Course getCourse() {
		return course;
	}



	public void setCourse(Course course) {
		this.course = course;
	}



	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		StudentOfTheCourse that = (StudentOfTheCourse) o;


		return true;
	}

}
